#%RAML 0.8
title: Item Storage
version: v2.0
protocols: [ HTTP, HTTPS ]
baseUri: http://localhost

documentation:
  - title: Item Storage API
    content: <b>Storage for items in the inventory</b>

schemas:
 - item: !include schema/item.json
 - items: !include schema/items.json

traits:
 - secured: !include ../raml-util/traits/auth.raml
 - language: !include ../raml-util/traits/language.raml
 - pageable: !include ../raml-util/traits/pageable.raml
 - searchable: !include ../raml-util/traits/searchable.raml

resourceTypes:
 - collection: !include ../raml-util/rtypes/collection.raml
 - collection-item: !include ../raml-util/rtypes/item-collection.raml

/item-storage:
  /items:
    displayName: Items
    type:
      collection:
        exampleCollection: !include  examples/items_get.json
        schemaCollection: items
        schemaItem: item
        exampleItem: !include  examples/item_get.json
    get:
      is: [pageable,
         searchable: {description: "by title (using CQL)",
                        example: "title=\"*uproot*\""},
          ]
    post:
    delete:
      responses:
        204:
          description: "All items deleted"
        500:
          description: "Internal server error, e.g. due to misconfiguration"
          body:
            text/plain:
              example: "Internal server error, contact administrator"
    /{itemId}:
      type:
        collection-item:
          exampleItem: !include examples/item_get.json
          schema: item
      get:
